<!--
 * @Description: 
 * @Version: 2.0
 * @Autor: zhangjx
 * @Date: 2023-05-26 18:21:33
 * @LastEditors: uphldjx 1373577124@qq.com
 * @LastEditTime: 2023-08-24 15:50:28
  style="filter:drop-shadow(20px 0 #fff)"
-->
<template>
	<i v-if="iconType == 'svg'">
		<svg class="icon svg" :aria-hidden="false" fill="currentColor">
			<use :xlink:href="`#${iconClass}`" />
		</svg>
	</i>
	<i v-else :class="iconClass"></i>
</template>

<script setup lang="ts">
const props = defineProps({
	icon: {
		type: String,
		default: 'iconfont icon-huzhuyanglao',
	},
})
const iconType = computed(() => {
	if (props.icon && props.icon.includes('iconfont')) {
		return 'svg'
	} else {
		return ''
	}
})
const iconClass = computed(() => {
	if (props.icon && props.icon.includes('iconfont')) {
		return props.icon.split(' ')[1]
	} else {
		return props.icon || 'el-icon-folder'
	}
})
</script>

<style scoped>
.icon {
	width: 100%;
	height: 100%;
}
</style>
